import {
	get
} from "../utils/db.js";

class BookModel {
	constructor() {
		this.page = 0;
		this.pageSize = 20;
	}
	//获取图书列表
	async getAll() {
		let page = this.page;
		let pageSize = this.pageSize;

		var skip = pageSize * page;
		var result = await get({
			collection: "book",
			skip,
			limit: pageSize
		});

		return result;
	}


	//获取热门搜索
	async getHot() {
		var result = await findAll("book", {
			status: 1
		}, {}, 0, 10);

		return result;
	}


}

export {
	BookModel
}